import echarts from 'echarts';
// 引入柱状图
import 'echarts/lib/chart/bar';
// 引入提示框和标题组件
import 'echarts/lib/component/tooltip';
import 'echarts/lib/component/title';
import storageApi from '../../../core/storage/storage';

function currentMonthSafetyController($rootScope, $scope, homeStatsService) {
  'ngInject';

  /*eslint-disable */
  this.initChart = () => {
    const option = {
      color: ['#8fd7ee'],
      tooltip : {
        trigger: 'axis'
      },
      grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
      xAxis : [
        {
          type : 'category',
          boundaryGap : false,
          data : ['3.1','3.2','3.3','3.4','3.5','3.6','3.7']
        }
      ],
      yAxis : [
        {
          type : 'value'
        }
      ],
      series : [
        {
          name:'安全指数',
          type:'line',
          stack: '总量',
          areaStyle: {
            normal: {},
          },
          data:[20, 50, 80, 90, 130, 180, 200]
        }
      ]
    };
    const myChart = echarts.init(document.getElementById('current-month-safety'));
    myChart.setOption(option);
  }

  this.initChart();
}

export default currentMonthSafetyController;
